﻿@{
    ViewBag.Title = "Cập nhật bài viết";
    Layout = "~/Views/Shared/_Layout.Management.cshtml";
}


<form method="post" class="form" action="/Management/ArchiveList/Edit/@ViewBag.ArchiveId">
	<fieldset id="firstStep">
		<h2 class="app">
	        <strong>Express - Cập nhật bài viết</strong>
        </h2>
		<div class="errorMessage" data-bind="visible: InvalidateForm" >
		<span class="error">Xin hãy nhập thông tin bên dưới chính xác.</span>
		</div>				
		<div class="title">
			<h3>Thông tin bài viết</h3>
		</div>
		<div class="columns">
			<div class="col columnedit">
				<div class="row">
					<label>Tiêu đề bài viết:</label>
				</div>
                <div class="row">
					<input class="text" type="text" style="width:90%" data-bind="value: Title, attr:{maxlength:250}" name="Title" />
                </div>     
				<div class="row">
					<label>Danh mục:</label>
				</div>
                <div class="row">
					<div class="select-holder">
						<select data-bind='value: ArchiveTypeId, foreach: ArchiveTypeOptions, optionsCaption: "Select Type"' name="ArchiveTypeId">
							<option data-bind="value: ID, text: Name">Select Type</option>
						</select>
					</div>
                </div>         
				<div class="row">
					<label>Lựa chọn ảnh đính kèm:</label>
				</div>   
                <div class="row">
                    <img alt="Image here" width="175" data-bind="attr: {src: ImageUrl}" />
                    <input type="hidden" name="ImageUrl" data-bind="value: ImageUrl" />
                </div>
                <div class="row">
						<input type="file" name="fileDataArchive" id="fileDataArchive" class="btn btn-choose-file"  />
                        <div id="progress"></div>
				</div> 

				<div id="editform" class="row">
					<input class="text" type="checkbox" data-bind="checked: Active" name="Active" /> &nbsp;&nbsp;<strong>Kích hoạt</strong>
				</div>
				<div class="row">
					<label>Mô tả ngắn:</label>
				</div>
                <div class="row">
                    <textarea name="ShortDesc" rows="15" cols="80" style="width: 100%" data-bind="text: ShortDesc, attr:{maxlength:50}" name="ShortDesc">
                    </textarea>
                </div>
				<div id="editform" class="row">
					<label>Nội dung</label>
				</div>
                <div class="row">
					<textarea id="elm1" name="LongDesc" rows="35" cols="80" style="width: 100%" data-bind="text: LongDesc">
                    </textarea>
                </div>
			</div>
		</div> 

        <!-- button below -->
		<div class="foot-info">
			<h3 class="centered-wbtn centered-wbtn-bottom save">
  				<span>
  					<a class="btn btn-cancel-page" href="/Management/ArchiveList">previous</a>
					<input type="button" class="btn btn-submit-page" data-bind="click: SubmitForm" value="Submit" />
                </span>
			</h3>
		</div>
	</fieldset>
</form>
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/ViewModel/editarchive.js" type="text/javascript"></script>
<script src="/Scripts/jquery.uploadify.js" type="text/javascript"></script>
<script src="/Scripts/apps.js" type="text/javascript"></script>
<script src="/TinyMCE/tiny_mce.js" type="text/javascript"></script>
<script src="/TinyMCE/tinymce.initialize.js" type="text/javascript"></script>